#!/usr/bin/env python
"""
# -*- coding: utf-8 -*-
# @Time    : 2020/9/26 18:11
# @Author  : AshJo
# @Desc    : 单例模式
# @Filename: Singleton.py
# @Version : v1.0
"""


class Baby:
    __instance = None

    def __new__(cls, *args, **kwargs):
        if cls.__instance is None:
            cls.__instance = super().__new__(cls)
        return cls.__instance

    def __init__(self, clothes, trouser):
        self.clothes = clothes
        self.trouser = trouser


b1 = Baby('红上衣', '绿皮裤')
print(b1.clothes)
b2 = Baby('白上衣', '蓝短裤')
print(b1.clothes)
print(b2.clothes)

